com.droplets.api
Class DeprecatedMenu

java.lang.Object
  |
  +--com.droplets.api.Component
        |
        +--com.droplets.api.DeprecatedMenu

Deprecated. Use MenuBar instead.

Represents a pull-down application menu displayed at the top of the window. Menus are added directly to a window using Window.addComponent, not to a panel. The menus will appear in the order in which you add them, left to right.

Each menu has a name, which is the text that appears in the menu bar, and a set of choices (or "items"), which are passed to the constructor as a String array. The String "-" represents a menu separator (a horizontal bar drawn between items). Once the DeprecatedMenu object is constructed, its items cannot be changed.

When the user selects a menu item, a MenuSelectionEvent is delivered to all objects that have registered using addMenuSelectionListener. The event object contains a reference to the DeprecatedMenu and a menuItem property indicating which item was selected.

public class DeprecatedMenu
extends Component


Fields inherited from class com.droplets.api.Component
ANCHOR_CENTER, ANCHOR_EAST, ANCHOR_NORTH, ANCHOR_NORTHEAST, ANCHOR_NORTHWEST, ANCHOR_SOUTH, ANCHOR_SOUTHEAST, ANCHOR_SOUTHWEST, ANCHOR_WEST, FILL_BOTH, FILL_HORIZONTAL, FILL_NONE, FILL_VERTICAL
 
Constructor Summary
DeprecatedMenu(java.lang.String name, java.lang.String[] items, Window window)
          Deprecated.  
 
Method Summary
protected  void action(java.lang.String action, java.lang.String args)
          Deprecated. Called by the server when the user has performed an action on this component.
 void addMenuSelectionListener(MenuSelectionListener l)
          Deprecated. Adds a listener to be notified when the user selects an item in this menu.
protected  void fireMenuSelectionEvent(java.lang.String menuItem)
          Deprecated. Dispatches a MenuSelectionEvent to all listeners.
 java.lang.String getName()
          Deprecated. Gets the name of this menu, which is the string that appears on the menu bar.
 void removeMenuSelectionListener(MenuSelectionListener l)
          Deprecated. Removes a MenuSelectionListener.
 
Methods inherited from class com.droplets.api.Component
addActionListener, addAttributeChangeListener, addValueChangeListener, attributeChanged, constructionFailed, equals, fireActionEvent, fireAttributeChangeEvent, fireValueChangeEvent, getAnchor, getAttribute, getBgColor, getBoolAttribute, getBordersAttribute, getColorAttribute, getCursor, getCursorType, getDoubleAttribute, getEnabled, getFgColor, getFill, getFont, getGridHeight, getGridWidth, getGridX, getGridY, getInsets, getIntAttribute, getIPadX, getIPadY, getOpaque, getParent, getScriptingName, getSpecification, getStringAttribute, getToolTip, getValue, getVisible, getWeightX, getWeightY, getWindow, invalidate, isAddedToWindow, isContainer, isFocusTraversable, isFocusTraversableDefault, isValid, removeActionListener, removeAttributeChangeListener, removeValueChangeListener, requestFocus, reset, sendCommandAttribute, setAnchor, setAnchor, setArg, setAttribute, setBgColor, setBgColor, setBoolAttribute, setBordersAttribute, setColorAttribute, setCursor, setCursor, setCursorType, setDoubleAttribute, setEnabled, setEnabled, setEnterButton, setEnterButton, setEnterButton, setFgColor, setFgColor, setFill, setFill, setFocusTraversable, setFont, setFont, setGridHeight, setGridHeight, setGridWidth, setGridWidth, setGridX, setGridX, setGridY, setGridY, setInsets, setInsets, setIntAttribute, setIPadX, setIPadX, setIPadY, setIPadY, setItemListAttribute, setOpaque, setOpaque, setScriptingName, setStringAttribute, setToolTip, setValue, setValue, setVisible, setVisible, setWeightX, setWeightX, setWeightY, setWeightY, storeAttribute, valueChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DeprecatedMenu

public DeprecatedMenu(java.lang.String name,
                      java.lang.String[] items,
                      Window window)
Deprecated.  

Parameters:
name - the name of the menu. This is the string that will appear on the menu bar.
items - a string array containing the items in the menu. Use "-" to display a menu separator.
window - the window in which the menu should appear. Note that you still must add the menu using Window.addComponent.
See Also:
Constructs a new DeprecatedMenu component.
Method Detail

action

protected void action(java.lang.String action,
                      java.lang.String args)
Deprecated. 
Description copied from class: Component
Called by the server when the user has performed an action on this component. Subclasses should overridde to handle any actions that they need to handle in a special way - for example, if they maintain a separate listener list for some kinds of actions. If a subclass gets an action it doesn't recognize or is not interested in, it should pass the call on to this implementation in order to support notification of ActionListeners.
Overrides:
action in class Component
Following copied from class: com.droplets.api.Component
Parameters:
action - Identifies the type of action that occurred
args - Action-specific arguments (extra information)

addMenuSelectionListener

public void addMenuSelectionListener(MenuSelectionListener l)
Deprecated. 
Adds a listener to be notified when the user selects an item in this menu.
Parameters:
l - the listener

fireMenuSelectionEvent

protected void fireMenuSelectionEvent(java.lang.String menuItem)
Deprecated. 
Dispatches a MenuSelectionEvent to all listeners.
Parameters:
menuItem - the item within the menu that was selected

getName

public java.lang.String getName()
Deprecated. 
Gets the name of this menu, which is the string that appears on the menu bar.
Returns:
the name of the menu

removeMenuSelectionListener

public void removeMenuSelectionListener(MenuSelectionListener l)
Deprecated. 
Removes a MenuSelectionListener.
Parameters:
l - the listener to remove


Copyright © Droplets, 2001. All Rights Reserved.